package Reeks5.VanRansbeeck.Kevin.View;

import java.util.ArrayList;
import java.util.List;
import javax.swing.*;


public abstract class GameToolbar extends JToolBar {
    protected GameGUI parent;
    protected List<JComponent> comps;
    
    public GameToolbar(GameGUI c) {
        super();
        
        grabFocus();
        
        this.setGameGUI(c);
        
        comps = new ArrayList<JComponent>();
        
        this.setButtons();
        
        setFloatable(true);
    }
    
    public GameGUI getGameGUI() {
        return this.parent;
    }
    
    private void setGameGUI(GameGUI c) {
        this.parent = c;
    }
    
    abstract void setButtons();
    // te abstract... 
    /*
    private void setButtons() {
        if(this.labels.length > 0) {            
            for(int i = 0; i < this.labels.length; i++) {
                ButtonTypes type = (ButtonTypes)this.labels[i][0];
                //JComponent comp;
                
                if(type == ButtonTypes.SplashButton) {
                    SplashButton comp = new SplashButton(this.labels[i][1].toString());
                    add(comp);
                    comp.setEnabled(false);
                } else if(type == ButtonTypes.JTextField) {
                    JTextField comp = new JTextField(this.labels[i][1].toString());
                    comp.setFont(new Font("Serif", Font.BOLD, 24));
                    add(comp);
                    comp.setEnabled(false);
                } else if(type == ButtonTypes.JSpinner) {
                    //System.out.println(parent.getSpel().getSmallblind() * 2 + " -- " + parent.getSpel().getSmallblind() * 2 + " -- " + parent.getSpeler().getSaldo() + " -- " + parent.getSpel().getSmallblind() * 2);
                    // 6 - 6 - 1000 - 6
                    JSpinner comp = new JSpinner(
                            new SpinnerNumberModel(parent.getSpel().getSmallblind() * 2, parent.getSpel().getSmallblind() * 2, parent.getSpeler().getSaldo(), parent.getSpel().getSmallblind() * 2)); 
                    
                    comp.setFont(new Font("Serif", Font.BOLD, 24));
                    add(comp);
                    comp.setEnabled(false);
                } else if(type == ButtonTypes.JSlider) {
                    JSlider comp = new JSlider(JSlider.HORIZONTAL, parent.getSpel().getSmallblind() * 2, parent.getSpeler().getSaldo(), parent.getSpel().getSmallblind() * 4);
                    comp.setMajorTickSpacing(parent.getSpel().getSmallblind() * 4);
                    comp.setMinorTickSpacing(parent.getSpel().getSmallblind() * 2);
                    comp.setPaintTicks(true);
                    comp.setPaintLabels(true);
                    comp.setFont(new Font("Serif", Font.BOLD, 24));
                    add(comp);
                    comp.setEnabled(false);
                } else if(type == ButtonTypes.JLabel) {
                    JLabel comp = new JLabel(this.labels[i][1].toString());
                    comp.setHorizontalTextPosition(JLabel.CENTER);
                    comp.setFont(new Font("Serif", Font.BOLD, 24));
                    
                    add(comp);
                }
                
                //add(comp);
            }
        }
    }
    
    */

    public abstract void toggleActionButtons();
}
